[CDAP-21245] Fix: Propagate parent logging context to asynchronous action and fork threads#16129
[CDAP-21245] Fix: Propagate parent logging context to asynchronous action and fork threads#16129riyaa14 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements logging context propagation for Workflow actions and fork branches in WorkflowDriver.java, ensuring that logs generated in worker threads carry the correct context from the parent thread. The review feedback identifies a critical issue where the catch blocks for error logging are positioned outside the try-with-resources blocks. This causes the error logs to be emitted after the logging context has been reverted, resulting in missing context information. It is recommended to nest the try-catch blocks inside the try-with-resources scope and to consider catching Throwable to ensure all failures are logged with the correct context.
1197f98 to
6837226
Compare
|



Summary
Issue:
Logging Context doesn't get propagated in parallel branches in pipelines.
Solution:
Ensures that the
LoggingContextfrom the current workflow thread is correctly captured and propagated to background worker threads when running asynchronous action nodes and parallel fork branches.Changes
LoggingContextbefore spinning up new threads inexecuteActionandexecuteFork.Testing
Pipeline execution successful:
Before changes:
All labels aren't propagated in parallel branches.
parallel:
After changes:
All 10 labels are propagated.
linear
parallel: